package day02;

import java.util.Random;
import java.util.Scanner;

public class Random1 {


public static void main(String[] args) {
//	for (int i = 0; i < 10; i++) {
//		//获得random类对象
//		Random r =new Random();
//		int j =r.nextInt(100);
//		System.out.println(j);
//	}
	
	System.out.println("===============");
	System.out.println("请输入一个数");
	Scanner sc =new Scanner(System.in);
	int j =sc.nextInt();
	for (int i = 0; i < 10; i++) {
		double a =Math.random()*100+1;
		//类型强制转换
		int b =(int) a;
		System.out.println(b);
		if (j==b) {
			System.out.println("获取到了"+j);
		} else {
			System.out.println("本次什么都未获取到");
		}
	}sc.close();
}
}
